/**
 * @param {string} s
 * @param {number} n
 * @return {string}
 */
var reverseLeftWords = function(s, n) {
    return s.slice(n) + s.slice(0, n)
};
var reverseLeftWords = function(s, n) {
    let res = ''
    for (let i = n; i< s.length; i++) {
        res += s[i]
    }
    for (let j = 0; j < n; j++) {
        res += s[j]
    }
    return res
}
let s = "abcdefg"
let n = 2
console.log(reverseLeftWords(s, n))